package top.juntech.msweatherreport.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import top.juntech.msweatherreport.vo.City;
import top.juntech.msweatherreport.vo.WeatherResponse;

import java.util.List;

@FeignClient(name = "ms-weather-zuul",fallback = WeatherDataClinetHystrix.class)
public interface WeatherDataClient {
    /**
     * 获取城市列表
     * @return
     * @throws Exception
     */
    @GetMapping("/city/cities")
    List<City> listCity() throws Exception;
    /**
     * 更具Id获取天气
     * @param cityId
     * @return
     */
    @GetMapping("/data/weather/cityId/{cityId}")
    WeatherResponse getDataByCityId(@PathVariable("cityId") String cityId);
}
